# -*- coding: utf-8 -*-
'''
Created on 2012-4-19

@author: deadblue
'''
from cn._2dland.handler import bot, account, log
from google.appengine.ext import webapp
from google.appengine.ext.webapp import util, template
import logging

def main():
    # 设置日志级别
    logging.getLogger().setLevel(logging.DEBUG)
    # 注册过滤器
    template.register_template_library('cn._2dland.filters')
    # 注册处理程序
    app = webapp.WSGIApplication(url_mapping=[('/', account.IndexHandler),
                                              ('/manager', bot.BotManager),
                                              ('/worker', bot.BotWorker),
                                              ('/account', account.AccountHandler),
                                              ('/account/create', account.AccountCreateHandler),
                                              ('/account/update', account.AccountUpdateHandler),
                                              ('/account/reset', account.AccountResetHandler),
                                              ('/log', log.LogHandler),
                                              (r'/log/(\d+)', log.LogListHandler)
                                              ], debug=True)
    util.run_wsgi_app(app)

if __name__ == "__main__":
    main()